#include <iostream>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <cstring>

int main()
{
    // stdin stdout stderr
    umask(0);
    open("log.txt", O_CREAT | O_WRONLY | O_TRUNC, 0666);
    printf("Hello printf\n");
    std::cout << "Hello cout" << std::endl;
    const char* msg1 = "Hello stdout\n";
    write(1, msg1, strlen(msg1));
    const char* msg2 = "Hello stderr\n";
    write(2, msg2, strlen(msg2));
    return 0;
}
